package com.kb.design.enums;

import com.google.common.base.Objects;

public enum FileType {

    BASE("基础", "1"),
    ENCAPSULATION("封装", "2"),
    LAYOUT("布局", "3"),
    WIRING("布线", "4"),
    APPROVAL("审批", "5");


    private String key;
    private String value;
    // 构造方法
    private FileType(String key, String value) {
        this.key = key;
        this.value = value;
    }
    // 普通方法
    public static String getValue(String key) {
        for (FileType c : FileType.values()) {
            if (Objects.equal(key , c.getKey())) {
                return c.value;
            }
        }
        return null;
    }
    // get set 方法
    public void setKey(String key) {
        this.key = key;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
